import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import zhLocal from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

import ViewUI from 'view-design'
import 'view-design/dist/styles/iview.css'

import codemirror from 'vue-codemirror'
import 'codemirror/lib/codemirror.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

import _ from 'lodash'

Object.defineProperty(Vue.prototype, '$lodash', { value: _ })

// import Raven from 'raven-js'
// import RavenVue from 'raven-js/plugins/vue'

// if (process.env.NODE_ENV === 'production') {
//   Raven
//     .config('https://1c5d94549ac549138ed1471b20e4a4fe@sentry.tuhu.cn/454')
//     .addPlugin(RavenVue, Vue)
//     .install()
// }

// set ElementUI lang to EN
Vue.use(ElementUI, { zhLocal })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)
Vue.use(ViewUI)
Vue.use(codemirror)

import permission from '@/directive/permission/index.js'

Vue.directive('permission', permission)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
